/* Create an array of 10 random items.
   Find min and max. */

#include <iostream>
#include <cstdlib>

int main()
{
    int min_value = 0;
    int max_value = 0;
    int list[10];

    for (int i=0; i<10; i++){
        list[i] = rand();
        std::cout << list[i] << ' ';
    }
    std::cout << std::endl;

    min_value = list[0];                // Find min value
    for (int i=0; i<10; i++)
        if (min_value > list[i])
            min_value = list[i];
    std::cout << "Min value: " << min_value << std::endl;

    max_value = list[0];                // Find max value
    for (int i=0; i<10; i++)
        if(max_value < list[i])
            max_value = list[i];
    std::cout << "Max value: " << max_value << std::endl;

    return 0;
}
